#include <bits/stdc++.h>

using namespace std;
using ll = long long;

const ll mod = 1e9 + 7;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);

	int n;
	cin >> n;

	if (n == 1) {
		cout << 1 << endl;
		return 0;
	}

	ll pre = 1;
	for (int i = 1; i < n; i++) {
		pre = (pre * i) % mod;
	}


	ll ans = 0;

	for (int i = 1; i <= n; i++) {
		ans = (ans + (i % 5)) % mod;
	}

	ans = (ans * pre) % mod;

	cout << ans << endl;

	return 0;
}
